import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import AboutView from '../views/AboutView.vue'
import Test from '../views/Test.vue'
import Course from '../views/Course.vue'
import Html from '../views/Html.vue'
import Css from '../views/Css.vue'
Vue.use(VueRouter)

const routes = [{
		path: '/',
		name: 'home',
		component: HomeView
	},
	{
		path: '/about',
		name: 'about',
		component: AboutView
	},
	{
		path: '/course',
		component: Course,
		//二级路由
		children: [{
			path: 'html',
			component: Html,
		}, {
			path: 'css',
			component: Css,
		}, {
			// path: '/test/:name/:id',
			path: '/test',
			name: 'Test',
			component: Test,
			props: true
		}]
	}

]

const router = new VueRouter({
	routes,
	mode:'hash'
})

export default router
